package net.qiqb.core.domain.annotation;

import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;

/**
 * 抽象的聚合根父类
 *
 * @param <ID>
 */
@Slf4j
public abstract class AbstractAggregateRoot<ID extends Serializable> implements BaseEntity<ID> {
    /**
     * 聚合根id
     */
    @EntityId
    private final ID id;

    /**
     * 版本号
     */
    private Integer dataVersion;

    protected AbstractAggregateRoot(ID id) {
        this.id = id;
    }

    public ID getId() {
        //log.info("返回id");
        return id;
    }


    public Integer getDataVersion() {
        return dataVersion;
    }

    public void setDataVersion(Integer dataVersion) {
        this.dataVersion = dataVersion;
    }
}
